"""日志页面"""
from selenium.webdriver.common.by import By
from page.base_page import BasePage
class LogPage(BasePage):
    """数据准备"""
    url = "/index.php?m=log"
    #定位器
    click_add_log_locator = (By.LINK_TEXT, "新建日志")
    my_log_name_locator=(By.CSS_SELECTOR,"body > div.container > p > a:nth-child(4)")
    currently_add_log_name=(By.CSS_SELECTOR,"body > div.container > div.alert.alert-error")
    click_progress_statistics_locator = (By.LINK_TEXT, "进展统计")
    click_this_weeks_locator = (By.LINK_TEXT, "本周的")
    def click_add_log(self):
        """点击新建日志"""
        self.click(self.click_add_log_locator)
    def my_log_name(self):
        """返回我的日志文本"""
        return self.find_element(self.my_log_name_locator).text
    def currently_add_log(self):
        """返回实际结果文本"""
        return self.find_element(self.currently_add_log_name).text
    def click_progress(self):
        """点击进展统计"""
        self.click(self.click_progress_statistics_locator)
    def click_this_weeks(self):
        """点击本周的"""
        self.click(self.click_this_weeks_locator)